package com.learn.controller;

import com.learn.pojo.User;
import com.learn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/03/06
 * @description 表示层，负责与用户交互，显示数据和接收用户输入。
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/getUserById")
    public User getUserById(@RequestParam("id") Integer id) {
        return userService.selectById(id);
    }

    @PostMapping("/user")
    public User getUserById(User user) {
        return user;
    }
}
